Get the largest numberΒΆ

Get the largest number from a list.
def max_num_in_list(L):
    max = L[0]
    for a in L:
        if a > max:
            max = a
    return max

# test
print(max_num_in_list([1, 2, -8, 0]))    # 2